package com.czk.stream;

import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @Author:ChenZhangKun
 * @Date: 2023/2/25 16:21
 */
public class Stream_itrate {
    public static void main(String[] args) {

        // 无尽流
        System.out.println(Stream.iterate(1, e -> e * 2)
                // 截断
                .limit(5)
                .collect(Collectors.toList()));

        


    }
}
